import axIos from 'axios';

const ROOT_PATH = "/apis/cjlgb-system";

/**
 * 获取路由列表
 * @returns {Promise<AxiosResponse<T>>}
 */
export function getGatewayRoutes() {
    return axIos.get(ROOT_PATH + "/gateway/route");
}

/**
 * 添加路由
 * @param params
 * @returns {Promise<AxiosResponse<T>>}
 */
export function addGatewayRoute(params) {
    return axIos.post(ROOT_PATH + "/gateway/route",params);
}

/**
 * 根据Id删除路由
 * @param routeId
 * @returns {Promise<AxiosResponse<T>>}
 */
export function deleteGatewayRoute(routeId) {
    return axIos.delete(ROOT_PATH + "/gateway/route/" + routeId);
}

/**
 * 根据Id获取路由信息
 * @param routeId
 * @returns {Promise<AxiosResponse<T>>}
 */
export function getGatewayRoute(routeId) {
    return axIos.get(ROOT_PATH + "/gateway/route/" + routeId);
}

/**
 * 修改路由信息
 * @param params
 */
export function editGatewayRoute(params) {
    return axIos.put(ROOT_PATH + "/gateway/route",params);
}
